package com.xts.weinfo.ui.fragment;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.xts.weinfo.R;
import com.xts.weinfo.base.BaseFragment;
import com.xts.weinfo.base.Constants;
import com.xts.weinfo.presenter.ITInfoItemPresenter;
import com.xts.weinfo.presenter.SectionsPresenter;
import com.xts.weinfo.util.LogUtil;
import com.xts.weinfo.view.ITInfoItemView;
import com.xts.weinfo.view.SectionsView;

import butterknife.BindView;

public class ItInfoFragment extends BaseFragment<ITInfoItemPresenter> implements ITInfoItemView {
    @BindView(R.id.tv)
    TextView mTv;
    private int mId;
    private String mName;

    public static ItInfoFragment getInstance(int id,String name){
        ItInfoFragment fragment = new ItInfoFragment();
        Bundle bundle = new Bundle();
        bundle.putInt(Constants.DATA,id);
        bundle.putString(Constants.USERNAME,name);
        fragment.setArguments(bundle);
        return fragment;
    }
    @Override
    protected void initView(View inflate) {
        mId = getArguments().getInt(Constants.DATA);
        mName = getArguments().getString(Constants.USERNAME);
        mTv.setText(mName);
        LogUtil.print("initview:"+ mName);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected int getLayout() {
        return R.layout.fragment_it_info;
    }

    @Override
    protected ITInfoItemPresenter initPresenter() {
        return new ITInfoItemPresenter();
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        LogUtil.print("onDestroyView:"+mName);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        LogUtil.print("onDestroy:"+mName);
    }

    @Override
    public void onDetach() {
        super.onDetach();
        LogUtil.print("onDetach:"+mName);
    }
}
